/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-12
 * Time: 14:02
 */

//在同一个类中定义多个方法：要求不仅可以求2个整数的最大值，还可以求3个小数的最大值？
public class TestDemo {

    public static int max(int a, int b) {
        return a > b ? a : b;
    }

    public static double max(double a, double b, double c) {
        double x = 0;
        if (a > b) {
            x = a;
        } else {
            x = b;
        }
        if (x > c) {
            return x;
        }else {
            x=c;
        }
        return x;
    }

    public static void main(String[] args) {
        int a = 5;
        int b = 10;
        System.out.println(max(a, b));
        double c = 5.5;
        double d = 6.6;
        double e = 7.7;
        System.out.println(max(c, d, e));
    }
}
